package com.aistar.service.impl;

import com.aistar.mapper.CustomerMapper;
import com.aistar.pojo.Customer;
import com.aistar.service.TestService;
import com.aistar.util.MessageUtil;
import com.aistar.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestServiceImpl implements TestService {



    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public ServerResponse getById(Integer id) {
         Customer customer = customerMapper.selectByPrimaryKey(id);
        if (customer != null)
            return ServerResponse.getDataSuccess(customer);
        else
            return ServerResponse.getDataFailed(MessageUtil.NO_DATA);

    }

}

